package ecom.nopecom.util;

public class ConsumerProvider {

	static Consumer consumer;

	
	public static Consumer registerUser(String username,String password,String firstname)
	{
		consumer = new Consumer();
		consumer.username = username;
		consumer.password = password;
		consumer.firstname = firstname;
		return consumer;
	}
	
	public static Consumer registerUserWithDefaultValues()
	{
		//bring the values from properties files
		consumer = new Consumer();
		consumer.username = "defaultuser1@email.com";
		consumer.password = "reliance12";
		consumer.firstname = "Sample";
        return  addDefaultValues(consumer);

		//return consumer;
	}
    public static Consumer addDefaultValues(Consumer c)
    {
        c.gender = 'M';
        c.lastname = "Lastname";
        c.dateOfBirth = "1/January/1966";
        return consumer;
    }

	public static Consumer getConsumer()
	{
		return (consumer==null)?registerUserWithDefaultValues():addDefaultValues(consumer);
	}
	
}
